<%@page import="java.util.List"%>
<%@page import="com.libweb.model.dto.Book"%>
<%@page import="com.libweb.model.dto.Member"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>

<!DOCTYPE html>

<html>
<head>
	<meta charset="utf-8" />
    <title></title>
    <link rel="Stylesheet" href="/libweb/styles/default.css" />
</head>
<body>

    <div id="pageContainer">
    	
    	<!--  
    	<jsp:include page="/WEB-INF/views/include/header.jsp" />
        -->
        <!--  
        <%@ include file="/WEB-INF/views/include/header.jsp" %>
        -->
        
        <% pageContext.include("/WEB-INF/views/include/header.jsp"); %>
        
        
        <div id="content">
        	<br /><br />
        	<div style='text-align:center'>
        	<% Member member = (Member)session.getAttribute("loginuser"); %>
        	<% if(member.getMemberId().equals("admin")) {%>
		        [&nbsp;<a href="registerform.action">도서 등록</a>&nbsp;]	
	        <% }else { }%>  
            	
		    </div>
       		<br /><br />        	
        	<table border="1" align="center" width="700px">
        		<tr style="height:30px;background-color:orange">
        			<td>도서번호</td>
        			<td>제목</td>
        			<td>출판사</td>
        			<td>저자</td>
        			<td>출간일</td>        			
        			<td>대여상태</td>
        			<td>등록일</td>
        		</tr>

				<% List<Book> books = (List<Book>)request.getAttribute("books"); %>
				<% for (Book book : books) { %>
        		<tr style="height:30px">
        			<td><%= book.getBookNo() %></td>
        			<td>
        				<a href='/libweb/book/view.action?bookno=<%= book.getBookNo() %>'>
        					<%= book.getTitle() %>
        				</a>
        			</td>
        			<td><%= book.getPublisher() %></td>
        			<td><%= book.getAuthor() %></td>
        			<td><%= book.getPubDate() %></td>	                   			
        			<td><%	if(book.isStatus()) { %>
        					대여 중
        				<%	}else { %>
        					대여 가능
        				<%	} %>
        			</td>
        			<td><%= book.getRegDate() %></td>
        		</tr>
        		<%	} %>        		
        	</table>          	   	
        </div>
    </div>
</body>
</html>









